<template>
  <el-container>
    <el-aside style="width: 15%">
      <div id="leftMenuList">
        <el-row class="tac">
          <el-col>
            <el-radio-group v-model="isCollapse">
              <el-radio-button :label="true"><i class="el-icon-arrow-left" title="收起"></i></el-radio-button>
              <el-radio-button :label="false"><i class="el-icon-arrow-right" title="展开"></i></el-radio-button>
            </el-radio-group>
            <el-menu default-active="2" collapse-transition="true" class="el-menu-vertical-demo" :collapse="isCollapse" :router="true" @open="handleOpen" @close="handleClose" background-color="#545c64" text-color="#fff" active-text-color="#ffd04b">
              <el-submenu index="1">
                <template slot="title">
                  <i class="el-icon-setting"></i>
                  <span>配置</span>
                </template>
                <el-submenu index="1-1">
                  <template slot="title">配置URL</template>
                  <el-menu-item index="configUrl">URL</el-menu-item>
                </el-submenu>
              </el-submenu>
              <el-submenu index="2">
                <template slot="title">
                  <i class="el-icon-search"></i>
                  <span>搜索</span>
                </template>
                <el-submenu index="2-1">
                  <template slot="title">搜索房子信息</template>
                  <el-menu-item index="roomInfo">全文搜索</el-menu-item>
                </el-submenu>
              </el-submenu>
            </el-menu>
          </el-col>
        </el-row>
      </div>
    </el-aside>
    <el-container style="width: 85%">
      <el-header style="font-size: 24px">爬虫后台管理系统</el-header>
      <el-main>
        <router-view/>
        <template>
          <el-carousel :interval="4000" type="card" height="150px">
            <el-carousel-item v-for="item in 6" :key="item">
              <h3>{{ item }}</h3>
            </el-carousel-item>
          </el-carousel>
        </template>
      </el-main>
      <el-footer style="font-size: 12px">版本：0.1v  作者：✪   </el-footer>
    </el-container>
  </el-container>
</template>

<script>
import ElContainer from 'element-ui/packages/container/src/main'
import ElAside from 'element-ui/packages/aside/src/main'

export default {
  components: {
    ElAside,
    ElContainer},
  name: 'App',
  data () {
    return {
      isCollapse: false
    }
  },
  methods: {
    handleOpen (key, keyPath) {
      console.log(key, keyPath)
    },
    handleClose (key, keyPath) {
      console.log(key, keyPath)
    }
  }
}
</script>

<style>

  .el-carousel__item h3 {
    color: #475669;
    font-size: 14px;
    opacity: 0.75;
    line-height: 200px;
    margin: 0;
  }
  .el-carousel__item:nth-child(2n) {
    background-color: #99a9bf;
  }

  .el-carousel__item:nth-child(2n+1) {
    background-color: #d3dce6;
  }
  .el-menu-vertical-demo:not(.el-menu--collapse) {
  }

  .el-header, .el-footer {
    background-color: #E9EEF3;
    text-align: center;
    line-height: 60px;
  }

  .el-aside {
    background-color: #E9EEF3;
    color: #333;
  }

  .el-main {
    background-color: #E9EEF3;
    color: #333;
    text-align: center;
  }

  body > .el-container {
    margin-bottom: 40px;
  }

#app {
  font-family: 'Avenir', Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
}
</style>
